package com.atguigu.spzx.cloud.feign.api.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
//import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
//import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
//@LoadBalancerClients(
//        value = {
//                //当@LoadBalanced注解代理的RestTemplate发起请求时
//                //远程访问的是spzx-cloud-user服务 则使用LoadBalancerConfig中配置的负载均衡策略处理
//                @LoadBalancerClient(value = "spzx-cloud-user" ,
//                        configuration = LoadBalancerConfig.class)
//        }
//)
public class RestTemplateConfig {
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
